<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>CUB: block_scan.cuh Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-38890655-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">CUB
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d583f216f1aafe19404e836b0c097ad2.html">cub</a></li><li class="navelem"><a class="el" href="dir_011e1c944d88f71be72e1e24a5fda7cf.html">block</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">block_scan.cuh</div>  </div>
</div><!--header-->
<div class="contents">
<a href="block__scan_8cuh.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2011, Duane Merrill.  All rights reserved.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright (c) 2011-2013, NVIDIA CORPORATION.  All rights reserved.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * </span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * modification, are permitted provided that the following conditions are met:</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *     * Redistributions of source code must retain the above copyright</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *       notice, this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *     * Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *       notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> *       documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *     * Neither the name of the NVIDIA CORPORATION nor the</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *       names of its contributors may be used to endorse or promote products</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *       derived from this software without specific prior written permission.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * </span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> ******************************************************************************/</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &quot;specializations/block_scan_raking.cuh&quot;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;specializations/block_scan_warp_scans.cuh&quot;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &quot;../util_arch.cuh&quot;</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;../util_type.cuh&quot;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;../util_namespace.cuh&quot;</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;CUB_NS_PREFIX</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">namespace </span>cub {</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment"> * Algorithmic variants</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment"> ******************************************************************************/</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23ab">   56</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23ab" title="BlockScanAlgorithm enumerates alternative algorithms for cub::BlockScan to compute a parallel prefix ...">BlockScanAlgorithm</a></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;{</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23aba0fa6cac57b7df2f475a67af053b9371c">   77</a></span>&#160;    <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23aba0fa6cac57b7df2f475a67af053b9371c">BLOCK_SCAN_RAKING</a>,</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23abadc8dfe7760ac97ddde467ecf1070674f">   87</a></span>&#160;    <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23abadc8dfe7760ac97ddde467ecf1070674f">BLOCK_SCAN_RAKING_MEMOIZE</a>,</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23aba7f51e58246eb53f1a97bd1bc8c0f400f">  107</a></span>&#160;    <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23aba7f51e58246eb53f1a97bd1bc8c0f400f">BLOCK_SCAN_WARP_SCANS</a>,</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;};</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="comment"> * Block scan</span></div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="comment"> ******************************************************************************/</span></div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keyword">typename</span>            T,</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordtype">int</span>                 BLOCK_THREADS,</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23ab" title="BlockScanAlgorithm enumerates alternative algorithms for cub::BlockScan to compute a parallel prefix ...">BlockScanAlgorithm</a>  ALGORITHM = <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23aba0fa6cac57b7df2f475a67af053b9371c">BLOCK_SCAN_RAKING</a>&gt;</div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html">  186</a></span>&#160;<span class="keyword">class </span><a class="code" href="classcub_1_1_block_scan.html" title="The BlockScan class provides collective methods for computing a parallel prefix sum/scan of items par...">BlockScan</a></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;{</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;<span class="comment">     * Constants and typedefs</span></div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;<span class="comment">     ******************************************************************************/</span></div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23ab" title="BlockScanAlgorithm enumerates alternative algorithms for cub::BlockScan to compute a parallel prefix ...">BlockScanAlgorithm</a> SAFE_ALGORITHM =</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;        ((ALGORITHM == <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23aba7f51e58246eb53f1a97bd1bc8c0f400f">BLOCK_SCAN_WARP_SCANS</a>) &amp;&amp; (BLOCK_THREADS % <a class="code" href="structcub_1_1_arch_props.html#a378def3dee75e77eb135efcf6f0ca063ac5a2eb5b9e3b50dd43ad67c1ff020d9c" title="Log of the number of threads per warp. ">PtxArchProps::WARP_THREADS</a> != 0)) ?</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;            <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23aba0fa6cac57b7df2f475a67af053b9371c">BLOCK_SCAN_RAKING</a> :</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;            ALGORITHM;</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structcub_1_1_if.html" title="Type selection (IF ? ThenType : ElseType) ">If</a>&lt;(SAFE_ALGORITHM == <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23aba7f51e58246eb53f1a97bd1bc8c0f400f">BLOCK_SCAN_WARP_SCANS</a>),</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        BlockScanWarpScans&lt;T, BLOCK_THREADS&gt;,</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        BlockScanRaking&lt;T, BLOCK_THREADS, (SAFE_ALGORITHM == <a class="code" href="namespacecub.html#abec44bba36037c547e7e84906d0d23abadc8dfe7760ac97ddde467ecf1070674f">BLOCK_SCAN_RAKING_MEMOIZE</a>)&gt; &gt;::Type InternalBlockScan;</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> InternalBlockScan::TempStorage _TempStorage;</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="comment">     * Thread fields</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="comment">     ******************************************************************************/</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    _TempStorage &amp;temp_storage;</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="keywordtype">int</span> linear_tid;</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;<span class="comment">     * Utility methods</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;<span class="comment">     ******************************************************************************/</span></div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    __device__ __forceinline__ _TempStorage&amp; PrivateStorage()</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    {</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        __shared__ _TempStorage private_storage;</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;        <span class="keywordflow">return</span> private_storage;</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    }</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;</div>
<div class="line"><a name="l00241"></a><span class="lineno"><a class="code" href="structcub_1_1_block_scan_1_1_temp_storage.html">  241</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="structcub_1_1_block_scan_1_1_temp_storage.html" title="The operations exposed by BlockScan require a temporary memory allocation of this nested type for thr...">TempStorage</a> : <a class="code" href="structcub_1_1_uninitialized.html" title="A storage-backing wrapper that allows types with non-trivial constructors to be aliased in unions...">Uninitialized</a>&lt;_TempStorage&gt; {};</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;</div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a982e1407d00b704c3046cd72c48acabb">  252</a></span>&#160;    __device__ __forceinline__ <a class="code" href="classcub_1_1_block_scan.html#a982e1407d00b704c3046cd72c48acabb" title="Collective constructor for 1D thread blocks using a private static allocation of shared memory as tem...">BlockScan</a>()</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    :</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;        temp_storage(PrivateStorage()),</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;        linear_tid(threadIdx.x)</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    {}</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;</div>
<div class="line"><a name="l00262"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#ad0decc1ea510cd9c7df4cd380a26b1b1">  262</a></span>&#160;    __device__ __forceinline__ <a class="code" href="classcub_1_1_block_scan.html#ad0decc1ea510cd9c7df4cd380a26b1b1" title="Collective constructor for 1D thread blocks using the specified memory allocation as temporary storag...">BlockScan</a>(</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        <a class="code" href="structcub_1_1_block_scan_1_1_temp_storage.html" title="The operations exposed by BlockScan require a temporary memory allocation of this nested type for thr...">TempStorage</a> &amp;temp_storage)             </div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    :</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;        temp_storage(temp_storage.Alias()),</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;        linear_tid(threadIdx.x)</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    {}</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div>
<div class="line"><a name="l00273"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#ab364204badf83769f9140d799cc188a7">  273</a></span>&#160;    __device__ __forceinline__ <a class="code" href="classcub_1_1_block_scan.html#ab364204badf83769f9140d799cc188a7" title="Collective constructor using a private static allocation of shared memory as temporary storage...">BlockScan</a>(</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        <span class="keywordtype">int</span> linear_tid)                        </div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    :</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;        temp_storage(PrivateStorage()),</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;        linear_tid(linear_tid)</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    {}</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;</div>
<div class="line"><a name="l00284"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a6264c3383db3384184cb13f5f282f73d">  284</a></span>&#160;    __device__ __forceinline__ <a class="code" href="classcub_1_1_block_scan.html#a6264c3383db3384184cb13f5f282f73d" title="Collective constructor using the specified memory allocation as temporary storage. Each thread is identified using the supplied linear thread identifier. ">BlockScan</a>(</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;        <a class="code" href="structcub_1_1_block_scan_1_1_temp_storage.html" title="The operations exposed by BlockScan require a temporary memory allocation of this nested type for thr...">TempStorage</a> &amp;temp_storage,             </div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;        <span class="keywordtype">int</span> linear_tid)                        </div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    :</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;        temp_storage(temp_storage.Alias()),</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;        linear_tid(linear_tid)</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    {}</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;</div>
<div class="line"><a name="l00335"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#acd75d5aad2d1385bcbe15517011800e8">  335</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#acd75d5aad2d1385bcbe15517011800e8" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">ExclusiveSum</a>(</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;        T               input,                          </div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;        T               &amp;output)                        </div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;    {</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;        T block_aggregate;</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveSum(input, output, block_aggregate);</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    }</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;</div>
<div class="line"><a name="l00380"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a1fd276abbe08f7031a0333bf5c98c2f5">  380</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a1fd276abbe08f7031a0333bf5c98c2f5" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. Also provides every thread with the block-wide block_aggregate of all inputs. ">ExclusiveSum</a>(</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;        T               input,                          </div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;        T               &amp;block_aggregate)               </div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;    {</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveSum(input, output, block_aggregate);</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;    }</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> BlockPrefixOp&gt;</div>
<div class="line"><a name="l00465"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a97e041cbdfdb4005ffc65b45c9276403">  465</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a97e041cbdfdb4005ffc65b45c9276403" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. Instead of using 0 as the block-wide prefix, the call-back functor block_prefix_op is invoked by the first warp in the block, and the value returned by lane0 in that warp is used as the &quot;seed&quot; value that logically prefixes the threadblock&#39;s scan inputs. Also provides every thread with the block-wide block_aggregate of all inputs. ">ExclusiveSum</a>(</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;        T               input,                          </div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;        T               &amp;block_aggregate,               </div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)               </div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;    {</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveSum(input, output, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;    }</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;</div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;    <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> ITEMS_PER_THREAD&gt;</div>
<div class="line"><a name="l00519"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#ab8122c00c833f17c78af3d99dc76c5e8">  519</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#ab8122c00c833f17c78af3d99dc76c5e8" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes an array of consecutive input elements. ">ExclusiveSum</a>(</div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;        T                 (&amp;input)[ITEMS_PER_THREAD],   </div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;        T                 (&amp;output)[ITEMS_PER_THREAD])  </div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;    {</div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;        <a class="code" href="structcub_1_1_sum.html" title="Default sum functor. ">Sum</a> scan_op;</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#acd75d5aad2d1385bcbe15517011800e8" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">ExclusiveSum</a>(thread_partial, thread_partial);</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;    }</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;    <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> ITEMS_PER_THREAD&gt;</div>
<div class="line"><a name="l00574"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#aa92950e9b763459fb7e63c8d047c94c2">  574</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#aa92950e9b763459fb7e63c8d047c94c2" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes an array of consecutive input elements. Also provides every thread with the block-wide block_aggregate of all inputs. ">ExclusiveSum</a>(</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;        T                 (&amp;input)[ITEMS_PER_THREAD],       </div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;        T                 (&amp;output)[ITEMS_PER_THREAD],      </div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;        T                 &amp;block_aggregate)                 </div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;    {</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;        <a class="code" href="structcub_1_1_sum.html" title="Default sum functor. ">Sum</a> scan_op;</div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;</div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#acd75d5aad2d1385bcbe15517011800e8" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">ExclusiveSum</a>(thread_partial, thread_partial, block_aggregate);</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;    }</div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;</div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;</div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;        <span class="keywordtype">int</span> ITEMS_PER_THREAD,</div>
<div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;        <span class="keyword">typename</span> BlockPrefixOp&gt;</div>
<div class="line"><a name="l00680"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#ab6f9a0fa1ac832dcfb31bfacd7f1e22b">  680</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#ab6f9a0fa1ac832dcfb31bfacd7f1e22b" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes an array of consecutive input elements. Instead of using 0 as the block-wide prefix, the call-back functor block_prefix_op is invoked by the first warp in the block, and the value returned by lane0 in that warp is used as the &quot;seed&quot; value that logically prefixes the threadblock&#39;s scan inputs. Also provides every thread with the block-wide block_aggregate of all inputs. ">ExclusiveSum</a>(</div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;        T                 (&amp;input)[ITEMS_PER_THREAD],   </div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;        T                 (&amp;output)[ITEMS_PER_THREAD],  </div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;        T                 &amp;block_aggregate,             </div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;        BlockPrefixOp     &amp;block_prefix_op)             </div>
<div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;    {</div>
<div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;        <a class="code" href="structcub_1_1_sum.html" title="Default sum functor. ">Sum</a> scan_op;</div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;</div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#acd75d5aad2d1385bcbe15517011800e8" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">ExclusiveSum</a>(thread_partial, thread_partial, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;</div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;    }</div>
<div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;</div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;</div>
<div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;</div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ScanOp&gt;</div>
<div class="line"><a name="l00744"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7">  744</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;        T               input,                          </div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;        T               identity,                       </div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;        ScanOp          scan_op)                        </div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;    {</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;        T block_aggregate;</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveScan(input, output, identity, scan_op, block_aggregate);</div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;    }</div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;</div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;</div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ScanOp&gt;</div>
<div class="line"><a name="l00795"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a1e09b0882138e34c23559c4d9a89a0d8">  795</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a1e09b0882138e34c23559c4d9a89a0d8" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. Also provides every thread with the block-wide block_aggregate of all inputs. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l00796"></a><span class="lineno">  796</span>&#160;        T               input,              </div>
<div class="line"><a name="l00797"></a><span class="lineno">  797</span>&#160;        T               &amp;output,            </div>
<div class="line"><a name="l00798"></a><span class="lineno">  798</span>&#160;        <span class="keyword">const</span> T         &amp;identity,          </div>
<div class="line"><a name="l00799"></a><span class="lineno">  799</span>&#160;        ScanOp          scan_op,            </div>
<div class="line"><a name="l00800"></a><span class="lineno">  800</span>&#160;        T               &amp;block_aggregate)   </div>
<div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;    {</div>
<div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveScan(input, output, identity, scan_op, block_aggregate);</div>
<div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;    }</div>
<div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;</div>
<div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;</div>
<div class="line"><a name="l00885"></a><span class="lineno">  885</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l00886"></a><span class="lineno">  886</span>&#160;        <span class="keyword">typename</span> ScanOp,</div>
<div class="line"><a name="l00887"></a><span class="lineno">  887</span>&#160;        <span class="keyword">typename</span> BlockPrefixOp&gt;</div>
<div class="line"><a name="l00888"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#ab61af70303ff86b4aead54c1f83f0e30">  888</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#ab61af70303ff86b4aead54c1f83f0e30" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. the call-back functor block_prefix_op is invoked by the first warp in the block, and the value returned by lane0 in that warp is used as the &quot;seed&quot; value that logically prefixes the threadblock&#39;s scan inputs. Also provides every thread with the block-wide block_aggregate of all inputs. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l00889"></a><span class="lineno">  889</span>&#160;        T               input,                          </div>
<div class="line"><a name="l00890"></a><span class="lineno">  890</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l00891"></a><span class="lineno">  891</span>&#160;        T               identity,                       </div>
<div class="line"><a name="l00892"></a><span class="lineno">  892</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l00893"></a><span class="lineno">  893</span>&#160;        T               &amp;block_aggregate,               </div>
<div class="line"><a name="l00894"></a><span class="lineno">  894</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)               </div>
<div class="line"><a name="l00895"></a><span class="lineno">  895</span>&#160;    {</div>
<div class="line"><a name="l00896"></a><span class="lineno">  896</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveScan(input, output, identity, scan_op, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l00897"></a><span class="lineno">  897</span>&#160;    }</div>
<div class="line"><a name="l00898"></a><span class="lineno">  898</span>&#160;</div>
<div class="line"><a name="l00899"></a><span class="lineno">  899</span>&#160;</div>
<div class="line"><a name="l00901"></a><span class="lineno">  901</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160;</div>
<div class="line"><a name="l00906"></a><span class="lineno">  906</span>&#160;</div>
<div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160;        <span class="keyword">typename</span>        ScanOp&gt;</div>
<div class="line"><a name="l00951"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a5b21dfebcaf900cb516a06746dcb48b1">  951</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a5b21dfebcaf900cb516a06746dcb48b1" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes an array of consecutive input elements. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;        T                 (&amp;input)[ITEMS_PER_THREAD],   </div>
<div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160;        T                 (&amp;output)[ITEMS_PER_THREAD],  </div>
<div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160;        <span class="keyword">const</span> T           &amp;identity,                    </div>
<div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160;        ScanOp            scan_op)                      </div>
<div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160;    {</div>
<div class="line"><a name="l00957"></a><span class="lineno">  957</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l00958"></a><span class="lineno">  958</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l00959"></a><span class="lineno">  959</span>&#160;</div>
<div class="line"><a name="l00960"></a><span class="lineno">  960</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l00961"></a><span class="lineno">  961</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, identity, scan_op);</div>
<div class="line"><a name="l00962"></a><span class="lineno">  962</span>&#160;</div>
<div class="line"><a name="l00963"></a><span class="lineno">  963</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l00964"></a><span class="lineno">  964</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;    }</div>
<div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;</div>
<div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;</div>
<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160;        <span class="keyword">typename</span>        ScanOp&gt;</div>
<div class="line"><a name="l01012"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a1cda15ada4f880a7f428bd248c686710"> 1012</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a1cda15ada4f880a7f428bd248c686710" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes an array of consecutive input elements. Also provides every thread with the block-wide block_aggregate of all inputs. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160;        T                 (&amp;input)[ITEMS_PER_THREAD],   </div>
<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160;        T                 (&amp;output)[ITEMS_PER_THREAD],  </div>
<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;        <span class="keyword">const</span> T           &amp;identity,                    </div>
<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160;        ScanOp            scan_op,                      </div>
<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;        T                 &amp;block_aggregate)             </div>
<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160;    {</div>
<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160;</div>
<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, identity, scan_op, block_aggregate);</div>
<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;</div>
<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160;    }</div>
<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160;</div>
<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>&#160;</div>
<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>&#160;        <span class="keyword">typename</span>        ScanOp,</div>
<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>&#160;        <span class="keyword">typename</span>        BlockPrefixOp&gt;</div>
<div class="line"><a name="l01123"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#ab954851d7bd0fc7c3e2e16d31bfcb704"> 1123</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#ab954851d7bd0fc7c3e2e16d31bfcb704" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes an array of consecutive input elements. the call-back functor block_prefix_op is invoked by the first warp in the block, and the value returned by lane0 in that warp is used as the &quot;seed&quot; value that logically prefixes the threadblock&#39;s scan inputs. Also provides every thread with the block-wide block_aggregate of all inputs. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],     </div>
<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD],    </div>
<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>&#160;        T               identity,                       </div>
<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>&#160;        T               &amp;block_aggregate,               </div>
<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)               </div>
<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>&#160;    {</div>
<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>&#160;</div>
<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, identity, scan_op, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>&#160;</div>
<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>&#160;    }</div>
<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>&#160;</div>
<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>&#160;</div>
<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>&#160;</div>
<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>&#160;<span class="preprocessor">#ifndef DOXYGEN_SHOULD_SKIP_THIS    // Do not document</span></div>
<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>&#160;</div>
<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>&#160;</div>
<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ScanOp&gt;</div>
<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>&#160;        ScanOp          scan_op)                        </div>
<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>&#160;    {</div>
<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>&#160;        T block_aggregate;</div>
<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveScan(input, output, scan_op, block_aggregate);</div>
<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>&#160;    }</div>
<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>&#160;</div>
<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>&#160;</div>
<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ScanOp&gt;</div>
<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>&#160;        T               &amp;block_aggregate)               </div>
<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>&#160;    {</div>
<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveScan(input, output, scan_op, block_aggregate);</div>
<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>&#160;    }</div>
<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>&#160;</div>
<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>&#160;</div>
<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>&#160;        <span class="keyword">typename</span> ScanOp,</div>
<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>&#160;        <span class="keyword">typename</span> BlockPrefixOp&gt;</div>
<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>&#160;        T               &amp;block_aggregate,               </div>
<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)               </div>
<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>&#160;    {</div>
<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>&#160;        InternalBlockScan(temp_storage, linear_tid).ExclusiveScan(input, output, scan_op, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>&#160;    }</div>
<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>&#160;</div>
<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>&#160;</div>
<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>&#160;</div>
<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>&#160;</div>
<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>&#160;        <span class="keyword">typename</span>        ScanOp&gt;</div>
<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>&#160;        T                 (&amp;input)[ITEMS_PER_THREAD],   </div>
<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>&#160;        T                 (&amp;output)[ITEMS_PER_THREAD],  </div>
<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>&#160;        ScanOp            scan_op)                      </div>
<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>&#160;    {</div>
<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>&#160;</div>
<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, scan_op);</div>
<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>&#160;</div>
<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial, (linear_tid != 0));</div>
<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>&#160;    }</div>
<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>&#160;</div>
<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>&#160;</div>
<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>&#160;        <span class="keyword">typename</span>        ScanOp&gt;</div>
<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],     </div>
<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD],    </div>
<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>&#160;        T               &amp;block_aggregate)               </div>
<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>&#160;    {</div>
<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>&#160;</div>
<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, scan_op, block_aggregate);</div>
<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>&#160;</div>
<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial, (linear_tid != 0));</div>
<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>&#160;    }</div>
<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>&#160;</div>
<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>&#160;</div>
<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>&#160;        <span class="keyword">typename</span>        ScanOp,</div>
<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>&#160;        <span class="keyword">typename</span>        BlockPrefixOp&gt;</div>
<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(</div>
<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],   </div>
<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD],  </div>
<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>&#160;        ScanOp          scan_op,                      </div>
<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>&#160;        T               &amp;block_aggregate,             </div>
<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)             </div>
<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>&#160;    {</div>
<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>&#160;        <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>&#160;        T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>&#160;</div>
<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>&#160;        <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, scan_op, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>&#160;</div>
<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>&#160;        <span class="comment">// Exclusive scan in registers with prefix</span></div>
<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>&#160;        <a class="code" href="group___thread_module.html#ga37fa2b0ca9bb32096517480e98894545" title="Perform a sequential exclusive prefix scan over LENGTH elements of the input array, seeded with the specified prefix. The aggregate is returned. ">ThreadScanExclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>&#160;    }</div>
<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>&#160;</div>
<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>&#160;</div>
<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>&#160;</div>
<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>&#160;<span class="preprocessor">#endif // DOXYGEN_SHOULD_SKIP_THIS</span></div>
<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>&#160;</div>
<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>&#160;</div>
<div class="line"><a name="l01381"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a570505ebdc51e2e47373fcb87e9a7d62"> 1381</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a570505ebdc51e2e47373fcb87e9a7d62" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">InclusiveSum</a>(</div>
<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>&#160;        T               &amp;output)                        </div>
<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>&#160;    {</div>
<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>&#160;        T block_aggregate;</div>
<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>&#160;        InternalBlockScan(temp_storage, linear_tid).InclusiveSum(input, output, block_aggregate);</div>
<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>&#160;    }</div>
<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>&#160;</div>
<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>&#160;</div>
<div class="line"><a name="l01426"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a0de622762b27b095583770c66b905358"> 1426</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a0de622762b27b095583770c66b905358" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. Also provides every thread with the block-wide block_aggregate of all inputs. ">InclusiveSum</a>(</div>
<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>&#160;        T               &amp;block_aggregate)               </div>
<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>&#160;    {</div>
<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>&#160;        InternalBlockScan(temp_storage, linear_tid).InclusiveSum(input, output, block_aggregate);</div>
<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>&#160;    }</div>
<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>&#160;</div>
<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>&#160;</div>
<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>&#160;</div>
<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> BlockPrefixOp&gt;</div>
<div class="line"><a name="l01512"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a39c481101dfa78b09374cab355712de9"> 1512</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a39c481101dfa78b09374cab355712de9" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. Instead of using 0 as the block-wide prefix, the call-back functor block_prefix_op is invoked by the first warp in the block, and the value returned by lane0 in that warp is used as the &quot;seed&quot; value that logically prefixes the threadblock&#39;s scan inputs. Also provides every thread with the block-wide block_aggregate of all inputs. ">InclusiveSum</a>(</div>
<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>&#160;        T               &amp;block_aggregate,               </div>
<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)               </div>
<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>&#160;    {</div>
<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>&#160;        InternalBlockScan(temp_storage, linear_tid).InclusiveSum(input, output, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>&#160;    }</div>
<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>&#160;</div>
<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>&#160;</div>
<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>&#160;</div>
<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>&#160;</div>
<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>&#160;    <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> ITEMS_PER_THREAD&gt;</div>
<div class="line"><a name="l01566"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a88ffea45e2a8b5e3abb6e4c4777e66ef"> 1566</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a88ffea45e2a8b5e3abb6e4c4777e66ef" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes an array of consecutive input elements. ">InclusiveSum</a>(</div>
<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],     </div>
<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD])    </div>
<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>&#160;    {</div>
<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>&#160;        <span class="keywordflow">if</span> (ITEMS_PER_THREAD == 1)</div>
<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>&#160;        {</div>
<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#a570505ebdc51e2e47373fcb87e9a7d62" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">InclusiveSum</a>(input[0], output[0]);</div>
<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>&#160;        }</div>
<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>&#160;        {</div>
<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>&#160;            <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>&#160;            <a class="code" href="structcub_1_1_sum.html" title="Default sum functor. ">Sum</a> scan_op;</div>
<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>&#160;            T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>&#160;</div>
<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>&#160;            <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#acd75d5aad2d1385bcbe15517011800e8" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">ExclusiveSum</a>(thread_partial, thread_partial);</div>
<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>&#160;</div>
<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>&#160;            <span class="comment">// Inclusive scan in registers with prefix</span></div>
<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>&#160;            <a class="code" href="group___thread_module.html#ga4004b2a6bfb2b4f024b0389e9c46074c" title="Perform a sequential inclusive prefix scan over LENGTH elements of the input array. The aggregate is returned. ">ThreadScanInclusive</a>(input, output, scan_op, thread_partial, (linear_tid != 0));</div>
<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>&#160;        }</div>
<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>&#160;    }</div>
<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>&#160;</div>
<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>&#160;</div>
<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>&#160;    <span class="keyword">template</span> &lt;<span class="keywordtype">int</span> ITEMS_PER_THREAD&gt;</div>
<div class="line"><a name="l01631"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a553e70dd3e177545837438ded03b3bfd"> 1631</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a553e70dd3e177545837438ded03b3bfd" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes an array of consecutive input elements. Also provides every thread with the block-wide block_aggregate of all inputs. ">InclusiveSum</a>(</div>
<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],     </div>
<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD],    </div>
<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>&#160;        T               &amp;block_aggregate)               </div>
<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>&#160;    {</div>
<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>&#160;        <span class="keywordflow">if</span> (ITEMS_PER_THREAD == 1)</div>
<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>&#160;        {</div>
<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#a570505ebdc51e2e47373fcb87e9a7d62" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">InclusiveSum</a>(input[0], output[0], block_aggregate);</div>
<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>&#160;        }</div>
<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>&#160;        {</div>
<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>&#160;            <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>&#160;            <a class="code" href="structcub_1_1_sum.html" title="Default sum functor. ">Sum</a> scan_op;</div>
<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>&#160;            T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>&#160;</div>
<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>&#160;            <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#acd75d5aad2d1385bcbe15517011800e8" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">ExclusiveSum</a>(thread_partial, thread_partial, block_aggregate);</div>
<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>&#160;</div>
<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>&#160;            <span class="comment">// Inclusive scan in registers with prefix</span></div>
<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>&#160;            <a class="code" href="group___thread_module.html#ga4004b2a6bfb2b4f024b0389e9c46074c" title="Perform a sequential inclusive prefix scan over LENGTH elements of the input array. The aggregate is returned. ">ThreadScanInclusive</a>(input, output, scan_op, thread_partial, (linear_tid != 0));</div>
<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>&#160;        }</div>
<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>&#160;    }</div>
<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>&#160;</div>
<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>&#160;</div>
<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>&#160;        <span class="keywordtype">int</span> ITEMS_PER_THREAD,</div>
<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>&#160;        <span class="keyword">typename</span> BlockPrefixOp&gt;</div>
<div class="line"><a name="l01744"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#ae1a4a4dfbec4ec029dd6a8cce8b6c0a1"> 1744</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#ae1a4a4dfbec4ec029dd6a8cce8b6c0a1" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes an array of consecutive input elements. Instead of using 0 as the block-wide prefix, the call-back functor block_prefix_op is invoked by the first warp in the block, and the value returned by lane0 in that warp is used as the &quot;seed&quot; value that logically prefixes the threadblock&#39;s scan inputs. Also provides every thread with the block-wide block_aggregate of all inputs. ">InclusiveSum</a>(</div>
<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],     </div>
<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD],    </div>
<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>&#160;        T               &amp;block_aggregate,               </div>
<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)               </div>
<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>&#160;    {</div>
<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>&#160;        <span class="keywordflow">if</span> (ITEMS_PER_THREAD == 1)</div>
<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>&#160;        {</div>
<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#a570505ebdc51e2e47373fcb87e9a7d62" title="Computes an inclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">InclusiveSum</a>(input[0], output[0], block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>&#160;        }</div>
<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>&#160;        {</div>
<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>&#160;            <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>&#160;            <a class="code" href="structcub_1_1_sum.html" title="Default sum functor. ">Sum</a> scan_op;</div>
<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>&#160;            T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>&#160;</div>
<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>&#160;            <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#acd75d5aad2d1385bcbe15517011800e8" title="Computes an exclusive block-wide prefix scan using addition (+) as the scan operator. Each thread contributes one input element. ">ExclusiveSum</a>(thread_partial, thread_partial, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>&#160;</div>
<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>&#160;            <span class="comment">// Inclusive scan in registers with prefix</span></div>
<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>&#160;            <a class="code" href="group___thread_module.html#ga4004b2a6bfb2b4f024b0389e9c46074c" title="Perform a sequential inclusive prefix scan over LENGTH elements of the input array. The aggregate is returned. ">ThreadScanInclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>&#160;        }</div>
<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>&#160;    }</div>
<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>&#160;</div>
<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>&#160;</div>
<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>&#160;</div>
<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>&#160;</div>
<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ScanOp&gt;</div>
<div class="line"><a name="l01814"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#afb56064490291f37a712bcc3064ccbab"> 1814</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#afb56064490291f37a712bcc3064ccbab" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">InclusiveScan</a>(</div>
<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>&#160;        ScanOp          scan_op)                        </div>
<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>&#160;    {</div>
<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>&#160;        T block_aggregate;</div>
<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>&#160;        <a class="code" href="classcub_1_1_block_scan.html#afb56064490291f37a712bcc3064ccbab" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">InclusiveScan</a>(input, output, scan_op, block_aggregate);</div>
<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>&#160;    }</div>
<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>&#160;</div>
<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>&#160;</div>
<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ScanOp&gt;</div>
<div class="line"><a name="l01864"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a60d6f1fb7780e25c4a1442128113270b"> 1864</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a60d6f1fb7780e25c4a1442128113270b" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. Also provides every thread with the block-wide block_aggregate of all inputs. ">InclusiveScan</a>(</div>
<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>&#160;        T               &amp;block_aggregate)               </div>
<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>&#160;    {</div>
<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>&#160;        InternalBlockScan(temp_storage, linear_tid).InclusiveScan(input, output, scan_op, block_aggregate);</div>
<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>&#160;    }</div>
<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>&#160;</div>
<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>&#160;</div>
<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>&#160;        <span class="keyword">typename</span> ScanOp,</div>
<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>&#160;        <span class="keyword">typename</span> BlockPrefixOp&gt;</div>
<div class="line"><a name="l01956"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a7e1622b40fe73bdb6550f4dca2ae290a"> 1956</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a7e1622b40fe73bdb6550f4dca2ae290a" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. the call-back functor block_prefix_op is invoked by the first warp in the block, and the value returned by lane0 in that warp is used as the &quot;seed&quot; value that logically prefixes the threadblock&#39;s scan inputs. Also provides every thread with the block-wide block_aggregate of all inputs. ">InclusiveScan</a>(</div>
<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>&#160;        T               input,                          </div>
<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>&#160;        T               &amp;output,                        </div>
<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>&#160;        T               &amp;block_aggregate,               </div>
<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)               </div>
<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>&#160;    {</div>
<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>&#160;        InternalBlockScan(temp_storage, linear_tid).InclusiveScan(input, output, scan_op, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>&#160;    }</div>
<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>&#160;</div>
<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>&#160;</div>
<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>&#160;    <span class="comment">/******************************************************************/</span></div>
<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>&#160;</div>
<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>&#160;</div>
<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>&#160;        <span class="keyword">typename</span>        ScanOp&gt;</div>
<div class="line"><a name="l02016"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#afac59f8a498efb6a97f6c4a3b239576f"> 2016</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#afac59f8a498efb6a97f6c4a3b239576f" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes an array of consecutive input elements. ">InclusiveScan</a>(</div>
<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],     </div>
<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD],    </div>
<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>&#160;        ScanOp          scan_op)                        </div>
<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>&#160;    {</div>
<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>&#160;        <span class="keywordflow">if</span> (ITEMS_PER_THREAD == 1)</div>
<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>&#160;        {</div>
<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#afb56064490291f37a712bcc3064ccbab" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">InclusiveScan</a>(input[0], output[0], scan_op);</div>
<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>&#160;        }</div>
<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>&#160;        {</div>
<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>&#160;            <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>&#160;            T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>&#160;</div>
<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>&#160;            <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, scan_op);</div>
<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>&#160;</div>
<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>&#160;            <span class="comment">// Inclusive scan in registers with prefix</span></div>
<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>&#160;            <a class="code" href="group___thread_module.html#ga4004b2a6bfb2b4f024b0389e9c46074c" title="Perform a sequential inclusive prefix scan over LENGTH elements of the input array. The aggregate is returned. ">ThreadScanInclusive</a>(input, output, scan_op, thread_partial, (linear_tid != 0));</div>
<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>&#160;        }</div>
<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>&#160;    }</div>
<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>&#160;</div>
<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>&#160;</div>
<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>&#160;        <span class="keyword">typename</span>         ScanOp&gt;</div>
<div class="line"><a name="l02085"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#a2885c51314333f4b98dacefcd7c918fc"> 2085</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#a2885c51314333f4b98dacefcd7c918fc" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes an array of consecutive input elements. Also provides every thread with the block-wide block_aggregate of all inputs. ">InclusiveScan</a>(</div>
<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],     </div>
<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD],    </div>
<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>&#160;        T               &amp;block_aggregate)               </div>
<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>&#160;    {</div>
<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>&#160;        <span class="keywordflow">if</span> (ITEMS_PER_THREAD == 1)</div>
<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>&#160;        {</div>
<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#afb56064490291f37a712bcc3064ccbab" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">InclusiveScan</a>(input[0], output[0], scan_op, block_aggregate);</div>
<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>&#160;        }</div>
<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>&#160;        {</div>
<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>&#160;            <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>&#160;            T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>&#160;</div>
<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>&#160;            <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, scan_op, block_aggregate);</div>
<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>&#160;</div>
<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>&#160;            <span class="comment">// Inclusive scan in registers with prefix</span></div>
<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>&#160;            <a class="code" href="group___thread_module.html#ga4004b2a6bfb2b4f024b0389e9c46074c" title="Perform a sequential inclusive prefix scan over LENGTH elements of the input array. The aggregate is returned. ">ThreadScanInclusive</a>(input, output, scan_op, thread_partial, (linear_tid != 0));</div>
<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>&#160;        }</div>
<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>&#160;    }</div>
<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>&#160;</div>
<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>&#160;</div>
<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>&#160;    <span class="keyword">template</span> &lt;</div>
<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>&#160;        <span class="keywordtype">int</span>             ITEMS_PER_THREAD,</div>
<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>&#160;        <span class="keyword">typename</span>        ScanOp,</div>
<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>&#160;        <span class="keyword">typename</span>        BlockPrefixOp&gt;</div>
<div class="line"><a name="l02202"></a><span class="lineno"><a class="code" href="classcub_1_1_block_scan.html#abfce2a901cbcaac1852fef9f53d91a3a"> 2202</a></span>&#160;    __device__ __forceinline__ <span class="keywordtype">void</span> <a class="code" href="classcub_1_1_block_scan.html#abfce2a901cbcaac1852fef9f53d91a3a" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes an array of consecutive input elements. the call-back functor block_prefix_op is invoked by the first warp in the block, and the value returned by lane0 in that warp is used as the &quot;seed&quot; value that logically prefixes the threadblock&#39;s scan inputs. Also provides every thread with the block-wide block_aggregate of all inputs. ">InclusiveScan</a>(</div>
<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>&#160;        T               (&amp;input)[ITEMS_PER_THREAD],     </div>
<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>&#160;        T               (&amp;output)[ITEMS_PER_THREAD],    </div>
<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>&#160;        ScanOp          scan_op,                        </div>
<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>&#160;        T               &amp;block_aggregate,               </div>
<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>&#160;        BlockPrefixOp   &amp;block_prefix_op)               </div>
<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>&#160;    {</div>
<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>&#160;        <span class="keywordflow">if</span> (ITEMS_PER_THREAD == 1)</div>
<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>&#160;        {</div>
<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#afb56064490291f37a712bcc3064ccbab" title="Computes an inclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">InclusiveScan</a>(input[0], output[0], scan_op, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>&#160;        }</div>
<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>&#160;        {</div>
<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>&#160;            <span class="comment">// Reduce consecutive thread items in registers</span></div>
<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>&#160;            T thread_partial = <a class="code" href="group___thread_module.html#ga48320d1f549b7931ae1f72040f9e42dc" title="Perform a sequential reduction over LENGTH elements of the input array, seeded with the specified pre...">ThreadReduce</a>(input, scan_op);</div>
<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>&#160;</div>
<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>&#160;            <span class="comment">// Exclusive threadblock-scan</span></div>
<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>&#160;            <a class="code" href="classcub_1_1_block_scan.html#a2cd6dc7b523db630f4719b1b77df4db7" title="Computes an exclusive block-wide prefix scan using the specified binary scan_op functor. Each thread contributes one input element. ">ExclusiveScan</a>(thread_partial, thread_partial, scan_op, block_aggregate, block_prefix_op);</div>
<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>&#160;</div>
<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>&#160;            <span class="comment">// Inclusive scan in registers with prefix</span></div>
<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>&#160;            <a class="code" href="group___thread_module.html#ga4004b2a6bfb2b4f024b0389e9c46074c" title="Perform a sequential inclusive prefix scan over LENGTH elements of the input array. The aggregate is returned. ">ThreadScanInclusive</a>(input, output, scan_op, thread_partial);</div>
<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span>&#160;        }</div>
<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>&#160;    }</div>
<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>&#160;</div>
<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>&#160;</div>
<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>&#160;</div>
<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>&#160;};</div>
<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>&#160;</div>
<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>&#160;}               <span class="comment">// CUB namespace</span></div>
<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>&#160;CUB_NS_POSTFIX  <span class="comment">// Optional outer namespace(s)</span></div>
<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>&#160;</div>
</div><!-- fragment --></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Aug 23 2013 17:31:09 for CUB by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
<br>
&copy; 2013 NVIDIA Corporation
</small></address>
</body>
</html>
